﻿using FrameWork.Core.Enum;
using FrameWork.Core.Chain.Entitys;

namespace FrameWork.Core.China
{
    public interface IProcessNode
    {
        string NodeName { get; set; }

        string NodeCode { get; set; }

        int NodeType { get; set; }

        int[] SupportFlowTypes { get; }

        double NextOrder { get; set; }

        double Order { get; set; }

        EnumNodeState State { get; set; }

        double Index { get; set; }
        /// <summary>
        /// 准备工作
        /// </summary>
        /// <typeparam name="P"></typeparam>
        /// <typeparam name="D"></typeparam>
        /// <param name="processBase"></param>
        /// <param name="processDataBase"></param>
        void Prepare<P, D>(P processBase, D processDataBase) where P : ProcessBase where D : ProcessDataBase;
        /// <summary>
        /// 执行工作
        /// </summary>
        /// <typeparam name="P"></typeparam>
        /// <typeparam name="D"></typeparam>
        /// <param name="processBase"></param>
        /// <param name="processDataBase"></param>
        void Process<P, D>(P processBase, D processDataBase) where P : ProcessBase where D : ProcessDataBase;
        /// <summary>
        /// 清理工作
        /// </summary>
        /// <typeparam name="P"></typeparam>
        /// <typeparam name="D"></typeparam>
        /// <param name="processBase"></param>
        /// <param name="processDataBase"></param>
        void ClearUp<P, D>(P processBase, D processDataBase) where P : ProcessBase where D : ProcessDataBase;
    }
}
